package com.lmk;

import java.util.Scanner;

public class Test01 {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        System.out.print("请输入消费金额：");
        int money = sc.nextInt();

        System.out.println(
                "是否参加优惠换购活动：\n"
                        + "1：满50元，加2元换购百事可乐饮料1瓶\n"
                        + "2：满100元，加3元换购500ml可乐一瓶\n"
                        + "3：满100元，加10元换购5公斤面粉\n"
                        + "4：满200元，加10元可换购1个苏泊尔炒菜锅\n"
                        + "5：满200元，加20元可换购欧莱雅爽肤水一瓶\n"
                        + "0：不换购"
        );

        boolean ok = true;
        String goods = null;

        System.out.print("请选择：");
        int m = sc.nextInt();
        if(m == 0) return;

        switch (m){
            case 1:
                if(money >= 50){
                    money += 2;
                    goods = "百事可乐饮料1瓶";
                }else{
                    ok = false;
                }
                break;
            case 2:
                if(money >= 100){
                    money += 3;
                    goods = "500ml可乐一瓶";
                }else{
                    ok = false;
                }
                break;
            case 3:
                if(money >= 100){
                    money += 10;
                    goods = "5公斤面粉";
                }else{
                    ok = false;
                }
                break;
            case 4:
                if(money >= 200){
                    money += 10;
                    goods = "1个苏泊尔炒菜锅";
                }else{
                    ok = false;
                }
                break;
            case 5:
                if(money >= 200){
                    money += 20;
                    goods = "欧莱雅爽肤水一瓶";
                }else{
                    ok = false;
                }
                break;
        }

        if(ok){
            System.out.println("本次消费总金额：" + money);
            System.out.println("成功换购：" + goods);
        }else{
            System.out.println("您不符合换购条件");
        }
    }


}